package com.sinodata.ns.sv.impl;

import com.sinodata.ns.cell.CellBDInfo;
import com.sinodata.ns.cell.JLBDInfo;
import com.sinodata.ns.sv.ISupervisor;

import jt.classic.system.AbstractIBigObject;
import jt.classic.system.user.IUser;

import java.util.List;
import java.util.Map;


/**
 * 监理信息接口实现类
 *
 * @author mido
 *
 */
public class ISupervisorImpl extends AbstractIBigObject implements ISupervisor {
    private IUser user;
    private String mobileCode;
    private JLBDInfo bd;
    private CellBDInfo cellbd;

    public IUser iuser() {
        return this.user;
    }

    public String imobilecode() {
        return this.mobileCode;
    }

    public JLBDInfo ibd() {
        return this.bd;
    }

    public CellBDInfo icellbd() {
        return this.cellbd;
    }

    public void reload(Map map) {
        if (map != null) {
            this.info = map;

            this.bigoid = (String) this.info.get("NU_ID");
            this.user = (IUser) this.info.get("USER");
            this.bigoname = this.user.iname();
            this.mobileCode = (String) this.info.get("NU_MOBILECODE");
            this.bd = (JLBDInfo) this.info.get("JLBDINFO");

            String bditemid = (String) this.info.get("NU_BDITEMID");

            if ((this.bd != null) && (this.bd.icell() != null) &&
                    (this.bd.icell().ibd(bditemid) != null)) {
                this.cellbd = this.ibd().icell().ibd(bditemid);
            }
        }
    }
}
